package cn.chenwx.RabbitMQ2;


import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.Map;

@Component
@RabbitListener(queues = "TestDirectQueue")//监听的队列名称 TestDirectQueue
public class GetMessage {

    @RabbitHandler
    public void process(User testMessage) throws InterruptedException {
        Thread.sleep(20000);
        System.out.println("我是一号");
        System.out.println("DirectReceiver一号消费者收到消息  : " + testMessage.toString());
    }



}
